<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateReplenishmentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('replenishments', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('merchant_id')->index()->default(0)->comment('商户ID');
            $table->bigInteger('freightway_id')->index()->default(0)->comment('货道ID');
            $table->bigInteger('couter_id')->index()->default(0)->comment('设备ID');
            $table->tinyInteger('operation')->default(0)->comment('操作终端1PC端,2微信');
            $table->string('operationame', 100)->default('')->comment('操作人');
            $table->string('machines_name', 100)->default('')->comment('设备名称');
            $table->string('aisle_number', 100)->default('')->comment('货道编号');
            $table->integer('original_inventory')->default(0)->comment('原库存');
            $table->integer('an_inventory')->default(0)->comment('补货后库存');
            $table->integer('quantity_num')->default(0)->comment('补货数量');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('replenishments');
    }
}
